//
//  Particle.m
//  RocketAnimation
//
//  Created by iD Student on 7/10/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "Particle.h"

@implementation Particle
@synthesize image, velocityX, velocityY, lifetime;

- (id) initWithPoint:(CGPoint)point {
    image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"particle.png"]];
    image.frame = CGRectMake(point.x - 3, point.y + 13, 25, 25);
    velocityX = 0;
    velocityY = 0;
    return self;
}

- (BOOL) isAlive
{
    return lifetime > 0;
}

- (void) update
{
    lifetime--;
    image.center = CGPointMake(image.center.x + velocityX, image.center.y + velocityY);
}

@end
